#include "process.h"

void CreateChildProcess()
{

}


void GetCurrentSecond(struct timeval* value)
{
    gettimeofday(value, NULL);
}


unsigned long InAFewSeconds(struct timeval* value, size_t second)
{
    return value->tv_sec + second;
}


void GetNowTime(char* currentTime)
{
    struct timespec time;
    clock_gettime(CLOCK_REALTIME, &time);  //获取相对于1970到现在的秒数
    struct tm nowTime;
    localtime_r(&time.tv_sec, &nowTime);
    sprintf(currentTime, "%04d-%02d-%02d %02d:%02d:%02d", nowTime.tm_year + 1900, nowTime.tm_mon+1, nowTime.tm_mday, nowTime.tm_hour, nowTime.tm_min, nowTime.tm_sec);
}
